<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>线下查货服务</title>
    <jsp:include page="../../head.jsp"/>
</head>
<script type="text/javascript">
    var formSetting = {
        title: "线下查货服务",
        module: 'query',
        numCount: '2',
        columns: [
//            {
//                index: "COMPANY_CO",
//                name: "companyQp.companyCode",
//                type: "dropdown",
//                dropdownType: "ajax",
//                url: "companyqp-findCompanyByCode?tdateaa=" + timeNum(),
//                op: "eq",
//                minLength: 0,
//                label: "经营单位"
//            },
            {
                index: "DECLARATION_NO",
                name: "declaration_no",
                label: "报关单号"
            }, {
                index: "SAVE_TIME",
                name: "SAVE_TIME",
                type: "date",
                label: "提交时间起",
                op: "ge"
            }, {
                index: "SAVE_TIME",
                name: "SAVE_TIME",
                label: "提交时间止",
                type: "date",
                op: "le"
            }],
        buttons: {
            custom: [{
                id: "addbtn",
                value: "新增",
                click: function () {
                    window.location.href = "checkingGoods-manage";
                }
            }, {
                id: "editbtn",
                value: "修改",
                click: function () {
                    var id = $("#checkingGoodsDataGrid").jqGrid("getGridParam",
                                                                "selrow");
                    if (id) {
                        var checking_id = $("#checkingGoodsDataGrid").jqGrid('getRowData',
                                                                             id).checking_id;
                        window.location.href =
                                "checkingGoods-manage?checking_id=" + checking_id;
                    } else {
                        jw.alert("请点击需要操作的数据!");
                    }
                }
            }, {
                id: "exportbtn",
                value: "导出列表",
                click: function () {
                    var href = "http://127.0.0.1:6001/quiee/reportJsp/showReport.jsp?raq=/gtimp_checkingGoods.raq";
                    if ($(".selector").mrdForm("formVal", "company_co")) {
                        href += "&company_co=" + $(".selector").mrdForm("formVal", "company_co");
                    }
                    //window.location.href=href;
                }
            }]
        },
        grid: {
            id: "checkingGoodsDataGrid",
            title: "查询结果",
            url: "checkingGoods-findList?status=" + "${checkingGoods.status}",
            colModel: [{
                index: "CHECKING_ID",
                name: "checking_id",
                label: "CHECKING_ID",
                hidden: true
            }, {
                index: "companyQp",
                name: "companyQp.cOMPANY_NAME",
                label: "经营单位"
            }, {
                index: "ROUTE",
                name: "route",
                label: "转关/直航",
                formatter: function (cellvalue, options, row) {
                    if (cellvalue == "D") {
                        return "直航";
                    } else if (cellvalue == "T") {
                        return "转关";
                    }
                }
            }, {
                index: "DECLARATION_NO",
                name: "declaration_no",
                label: "报关单号"
            }, {
                index: "CONTAINER_INFO",
                name: "container_info",
                label: "柜数/尺码"
            }, {
                index: "CONTAINER_NO",
                name: "container_no",
                label: "柜号"
            }, {
                index: "HEAP_POSITION",
                name: "heap_position",
                label: "堆位"
            }, {
                index: "CAMERA_POSITION",
                name: "camera_position",
                label: "摄像头位"
            }, {
                index: "CHECK_OFFICIAL",
                name: "check_official",
                label: "查验关员"
            }, {
                index: "SEAL_NO",
                name: "seal_no",
                label: "封条号码"
            }, {
                index: "GOODS_NAME",
                name: "commodity.name",
                label: "货物名称"
            }, {
                index: "SPECIFICATIONS",
                name: "specifications",
                label: "规格/包装"
            }, {
                index: "CHECK_ITEMS",
                name: "check_items",
                label: "查验项目"
            }, {
                index: "DECLARATION_WEIGHT",
                name: "declaration_weight",
                label: "报关重量"
            }, {
                index: "RECEIPT_CHECK_NOTICE",
                name: "receipt_check_notice",
                label: "签收查验通知书"
            }, {
                index: "STATUS",
                name: "status",
                label: "完成情况",
                formatter: function (cellvalue, options, row) {
                    if (cellvalue == "1") {
                        return "已查验";
                    } else if (cellvalue == "0") {
                        return "未查验";
                    }
                }
            }, {
                index: "SAVE_TIME",
                name: "save_time",
                formatter: 'date',
                formatoptions: {srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'},
                label: "保存时间"
            }],
            sortname: "save_time",
            sortorder: "desc",
            jsonReader: {
//                root: "checkingGoodsDtos"
            }
        }
    };
    $(document).ready(function () {
        $("#checkingGoodsDataTable").mrdForm(formSetting);
    });
</script>
<body>
<div id="checkingGoodsDataTable"></div>
</body>
</html>
